package pers.cz.orm.dao.processor;

import pers.cz.common.exception.ErrorCode;
import pers.cz.common.exception.OrmException;
import pers.cz.orm.dao.dialect.MysqlDialect;

/**
 * @program: Jef-orm
 * @description: 覆盖，目前只支持mysql
 * @author: Cheng Zhi
 * @create: 2023-11-09 12:43
 **/
public class OverrideProcessor extends InsertProcessor {

    @Override
    public DbProcessorEnums getOperEnum() {
        return DbProcessorEnums.OVERRIDE;
    }

    @Override
    public String bindSql() {

        String key = getOperEnum().getKey();
        if (!(dialect instanceof MysqlDialect)) {
            throw new OrmException(ErrorCode.ORM_NO_DB_GRAMMER_ERROR, key);
        }
        return super.bindSql();
    }
}
